import { Component, OnInit ,Input} from '@angular/core';

@Component({
  selector: 'app-err-hint',
  templateUrl: './err-hint.component.html',
  styleUrls: ['./err-hint.component.scss']
})
export class ErrHintComponent implements OnInit {
  @Input()
  size:string;
  @Input()
  errShow:boolean;  //判断是否显示错误
  @Input()
  isChart:boolean;  //判断是不是表格的错误提示
  @Input()
  errMsg: string;  // 显示的错误的信息

  constructor() { }

  ngOnInit() {
    console.log(this.errShow);
    this.size = this.size || 'm';
    this.errShow = this.errShow || false;
    this.isChart = this.isChart || false;
    if(this.errMsg == '' || !this.errMsg){
      if(this.isChart){
        this.errMsg = 'Error Code: #1234566'
      } else {
        this.errMsg = 'Unable to get the data, please check the preference or contact the adminstrator';
      }
    }
  }

}
